<!-- this handles the automatic toc. use ## for subheads to auto-generate the on-page minitoc. if you use html tags, you must supply an ID for the heading element in order for it to appear in the minitoc. -->
<script>
  $(document).ready(function () {
    // Handler for .ready() called.

    const $toc = $('#toc');

    $toc.toc({
      minimumHeaders: 2,
      listType: 'ul',
      showSpeed: 'none',
      headers: '.docs h2,.docs h3'
    });

    /* this offset helps account for the space taken up by the floating toolbar. */
    // $toc.on('click', 'a', function () {
    //   var target = $(this.getAttribute('href')),
    //     scroll_target = target.offset().top

    //   $(window).scrollTop(scroll_target - 90);
    //   return false
    // });

    if (!$.trim($toc.html())) {
      $toc.hide();
    }

  });
</script>

<div id="toc"></div>
